<!doctype html>
<html>
<head>
</head>
<body>
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
?>

<!-- JavaScript -->
<script type="text/javascript" src="<?php echo base_url() ?>js/wufoo.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>js/zebra_datepicker.js"></script>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" href="<?php echo base_url() ?>css/zebra_datepicker_metallic.css" type="text/css">
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/chosen.css" media="screen, tv, projection" title="Default" />

<div id="container">
	<?php
    //Setting Awal Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
	
	$value = array(
		'username'	 			=> "",
		'pass'	 				=> "",
		'bagian'	 			=> "",			
		'uraian'	 			=> "",
		'jenis'	 				=> "",
		'legend'				=> "Form Input User",
		'info'					=> "Form pendaftaran user",
		'act_form'				=> "user_man/input_user/"
	);
	
	//Setting Value pada form Jika melakukan prosedur Edit terhadap data tertentu.
	if($status == "edit"){
		foreach($user_man->result() as $row){
			$value['username']	= $row->username;
			$value['pass'] = $row->PASS;
			$value['bagian'] = $row->BAGIAN;
			$value['uraian'] = $row->URAIAN;
			$value['jenis'] = $row->JENIS;
		}
		$value['legend'] = "Form Edit User";
		$value['info'] = "Form edit data user";
		$value['act_form'] = "user_man/edit_user/".$value['id_user'];
	}//end if
	
	?>
	<?php echo form_open_multipart($value["act_form"],'class="wufoo" name="form_user_man"'); ?>
	<fieldset class="fieldset">
	<legend class="legend">
		<?= $value["legend"] ?> |
	</legend>
	<div>
		<?php echo anchor(site_url('user_man'),img(array('src'=>'images/main/ic_back.png','border'=>'0','alt'=>'','width'=>'20px','height'=>'20px','margin-right'=>'10px')).'Kembali ke daftar helpdesk','Menampilkan halaman Daftar Helpdesk'); ?>
	</div>
	
	<div class="separator">
	</div>
 <!-- Konten -------------------------------------------------------------------------->
 <div id="contentform">
 <?php $atrib_jenis='style="width:250px;" id="jenis" class="chzn-select field"'?>
 <?php $atrib_bagian='style="width:250px;" id="bagian" class="chzn-select field"'?>
 <table border="0" width="100%" cellpadding="0" cellspacing="0">
 <tr valign="top">
 <td style="padding:10px;width:40%;">
	<ul>            
		
				<li>
                    <label class="desc">Username *</label>
                        <div>
                             <input type="text" name="username" class="new field" value="<?php echo set_value('username');?>"/>
                        </div>
						
                    <p class="instruct">
                            Isikan Username
                    </p>
                </li>
                <?php echo form_error('username'); ?>				
								
				<li>
                    <label class="desc">Password *</label>
                        <div>
                             <input type="password" name="pass" class="new field" value="<?php echo set_value('pass');?>"
                        </div>
                    <p class="instruct">
                            Password
                    </p>
                </li>
                <?php echo form_error('pass'); ?>
				
				<li>
                    <label class="desc">Bagian *</label>
                        <div>
                             <?php $bagian = 0;
                             if(set_value('bagian') != '') $bagian = set_value('bagian');
							 echo form_dropdown('bagian', $bagian_options, $bagian ,$atrib_bagian); ?>
                        </div>
                    <p class="instruct">
                            Bagian
                    </p>
                </li>
                <?php echo form_error('bagian'); ?>

				<li>
                    <label class="desc">Uraian *</label>
                        <div>
                             <input type="text" name="uraian" class="new field" value="<?php echo set_value('uraian');?>"/>
                        </div>
                    <p class="instruct">
                            Uraian permasalahan
                    </p>
                </li>
                <?php echo form_error('uraian'); ?>

                <li>
                    <label class="desc">Jenis *</label>
                        <div>
                             <?php $jenisa = 1;
                             $jenis_options['1'] = '--Pilih Jenis User--';
                             $jenis_options['A'] = 'A';
                             $jenis_options['B'] = 'B';
                             $jenis_options['C'] = 'C';
                             $jenis_options['D'] = 'D';
                             $jenis_options['E'] = 'E';
                             if(set_value('jenis') != '') $jenisa = set_value('jenis');
							 echo form_dropdown('jenis', $jenis_options, $jenisa ,$atrib_jenis); ?>
                        </div>
                    <p class="instruct">
                            Jenis
                    </p>
                </li>
                <?php echo form_error('jenis'); ?>

        		<li class="buttons">
                  <input id="submit" type="submit" value="Simpan" />
                  <input id="reset" type="reset" value="Reset" />
                </li>
	</ul>
	</td>
	</tr>
	</table>
</div>
</fieldset>
<?= form_close(); ?>
<script type="text/javascript" src="<?= base_url() ?>js/chosen.jquery.js"></script>
	<script type="text/javascript">
			$(".chzn-select").chosen({no_results_text: "Data yang dicari tidak ditemukan"});
		</script>
</div><!--container-->
</body>
</html>